package edu.nf.project.schedule;

import edu.nf.project.services.storeOperation.DishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author gjh
 * @Date 2025/6/18
 * @Description: 定时任务类
 */
@Component
public class DishPriorityScheduler {
    @Autowired
    private DishService dishService;

    @Scheduled(cron = "0 * * * * ?")
    public void runPriorityOptimization() {
        dishService.optimizeDishPriority();
        System.out.println("[定时任务] 优化菜品优先级任务执行完成。");
    }
}
